﻿CREATE TRIGGER tr_PageStore_Notify
ON dbo.t_PageStore
FOR INSERT, UPDATE
AS

RETURN -->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

DECLARE @LoanID int, @ImageTypeID int,@PageNumber int

SELECT @LoanID = t_Image.LoanID,
			 @ImageTypeID = t_Image.ImageTypeID,
			 @PageNumber = PageNumber
FROM  t_PageStore INNER JOIN
               t_Page ON t_PageStore.PageID = t_Page.ID INNER JOIN
               t_Image ON t_Page.ImageID = t_Image.ID
               
EXEC simg_Notify @LoanID,@ImageTypeID,@PageNumber

